﻿@model  P2PWeb.Models.Campaign
@{
    ViewBag.Title = "BorrowDetail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using P2PWeb.Controllers;
@using P2PWeb.Common
@using P2PWeb;

<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/app/BorrowDetail.js")"></script>
<link href="@Url.Content("~/Content/account.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/myBorrows.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/BorrowDetail.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />

<div class="main_loan">
    <div class="main_loan_top"></div>
    <div class="main_loan_content clearfjx">
        @{Html.RenderPartial("LeftMenus");}
        <div class="loan_content">
            <div class="inner">
                <div class="breadcrumbs rel">
                    <p>
                        <strong class="gtlt">&gt;&gt;</strong><span class="lay">账户首页</span>
                        <strong class="gtlt">&gt;&gt;</strong><span class="lay cur">借款单详情</span>
                    </p>
                </div>
            </div>
            @using (Html.BeginForm("ChangeBorrowState", "BorrowsManager"))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(m => m.ID)
                <div class="loan_box mt30">
                    <div class="loan_box">
                        <div class="mt30">
                            <div id="attachmentDialog">
                                <img id="attachmentImg" width="200px" height="200px" />
                            </div>
                            <table>
                                <tr>
                                    <td colspan="6" class="catelog">借款详情
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 100px;">下单时间:</td>
                                    <td colspan="2">@Model.CreationTime.GetValueOrDefault().ToString("yyyy年MM月dd日hh小时mm分")</td>
                                    <td>订单状态:</td>
                                    <td colspan="2">@(((CampaignState)Model.Status).GetDisplayName())</td>
                                </tr>
                                <tr>
                                    <td>借款类型:</td>
                                    <td colspan="2">@(((CalcType)Model.CalcType).GetDisplayName())</td>

                                </tr>
                                <tr>
                                    <td>借款期限:</td>
                                    <td colspan="2">@(@DateTime.Now.Add((Model.DueDate.GetValueOrDefault() - DateTime.Now)).Month + "个月")</td>
                                    <td>借款金额:</td>
                                    <td colspan="2">@Model.Amount.CustomFormatN()</td>
                                </tr>
                                <tr>
                                    <td>已筹金额:</td>
                                    <td colspan="2">@Model.RealAmount.CustomFormatN()</td>
                                    <td>年利率:</td>
                                    <td colspan="2">@Model.InterestRate.CustomFormatP()</td>

                                </tr>
                                <tr>
                                    <td>借款详情</td>
                                    <td colspan="5">
                                        <div class="remarkContainer">
                                            @Model.Info
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6" class="catelog">用户信息</td>
                                </tr>
                                <tr>
                                    <td>姓名:</td>
                                    <td>@Model.Account.AccountAuthentication.RealName</td>
                                    <td>年龄:</td>
                                    <td>@(Model.Account.AccountInfo.Age + "岁")</td>
                                    <td>性别:</td>
                                    <td>@(Model.Account.AccountInfo.Sex == 1 ? "男" : "女")</td>
                                </tr>
                                <tr>
                                    <td>手机电话:</td>
                                    <td colspan="2">@Model.Account.Mobile</td>
                                    <td>工作电话:</td>
                                    <td colspan="2">@Model.Account.WorkInfo.Phone</td>
                                </tr>
                                <tr>
                                    <td>抵押附件:
                                    </td>
                                    <td id="Upload" colspan="5">
                                        @for (int i = 0; i < Model.CampUpLoad.Count; i++)
                                        {
                                            <script>showAttachmentALink("@Model.CampUpLoad.Skip(i).Take(1).First().UpLoad", "Upload", "附件" + (@i+1), "attachmentAlink")</script>
                                        }
                                    </td>
                                </tr>

                                @*                            <tr>
                                <td>身份证:</td>
                                <td id="IDCardUrl">
                                    <script>showAttachmentALink("@Model.Account.AccountAuthentication.IDCardUrl", "IDCardUrl", "身份证")</script>
                                </td>
                                <td>银行工资卡流水:</td>
                                <td id="JobUrl">
                                    <script>showAttachmentALink("@Model.Account.AccountAuthentication.JobUrl", "JobUrl", "银行工资卡流水")</script>
                                </td>
                                <td>个人信用报告:</td>
                                <td id="CreditReportUrl">
                                    <script>showAttachmentALink("@Model.Account.AccountAuthentication.CreditReportUrl", "CreditReportUrl", "个人信用报告")</script>
                                </td>

                            </tr>
                            <tr>
                                <td>收入证明:</td>
                                <td id="IncomeUrl" colspan="2">
                                    <script>showAttachmentALink("@Model.Account.AccountAuthentication.IncomeUrl", "IncomeUrl", "收入证明")</script>
                                </td>
                                <td>个人贷款抵押证明:</td>
                                <td id="MortgageyUrl" colspan="2">
                                    <script>showAttachmentALink("@Model.Account.AccountAuthentication.MortgageyUrl", "MortgageyUrl", "个人贷款抵押证明")</script>
                                </td>
                            </tr>*@
                            </table>
                            @Html.Hidden("state")
                            @if (Model.Status == (int)CampaignState.LookThrough)
                            {
                                @Html.Hidden("toFinancingValue", (int)CampaignState.Financing)
                                @Html.Hidden("toCancelValue", (int)CampaignState.Cancel)
                                <button id="toFinancing" class="btn btn-toFinancing  mt10 mr5">批准投标</button>
                                <button id="toCancel" class="btn btn-toCancel  mt10 mr5">审核不通过</button>
                            }
                            <a id="BackBtn" class="btn btn-default  mt10">返回</a>
                        </div>
                    </div>
                </div>
            }


        </div>
    </div>
    <div class="main_loan_bottom"></div>
</div>
